package cn.yunhe.service;

import cn.yunhe.dao.IConsigneeDao;
import cn.yunhe.entity.Consignee;
import cn.yunhe.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

public class IConsigneeService {

    public int addConsignee(Consignee consignee){
        SqlSession session= SqlSessionFactoryUtil.getSqlSession();
        int flag=0;
        try {
            IConsigneeDao iConsigneeDao= session.getMapper(IConsigneeDao.class);
             flag= iConsigneeDao.addConsignee(consignee);
            session.commit();
            return flag;
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            session.close();
        }
        return flag;
    }
}
